package Entities;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table (name = "OrdenDeCompra")
public class Entity_OrdenDeCompra {

	@Id
	@GeneratedValue
	@Column (name = "id_ordendecompra")
	private int idOrdenDeCompra;
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name = "id_ordendecompra")
	private List<Entity_CompraInsumo> comprasinsumo;
	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "id_proveedor")
	private Entity_Proveedor proveedor;

	
	public Entity_OrdenDeCompra(List<Entity_CompraInsumo> comprasinsumo, Entity_Proveedor proveedor) {
		super();
		this.comprasinsumo = comprasinsumo;
		this.proveedor = proveedor;
	}

	public Entity_OrdenDeCompra()
	{
		
	}
	public List<Entity_CompraInsumo> getComprasinsumo() {
		return comprasinsumo;
	}

	public void setComprasinsumo(List<Entity_CompraInsumo> comprasinsumo) {
		this.comprasinsumo = comprasinsumo;
	}

	public Entity_Proveedor getProveedor() {
		return proveedor;
	}

	public void setProveedor(Entity_Proveedor proveedor) {
		this.proveedor = proveedor;
	}

	public int getIdOrdenDeCompra() {
		return idOrdenDeCompra;
	}

	public void setIdOrdenDeCompra(int idOrdenDeCompra) {
		this.idOrdenDeCompra = idOrdenDeCompra;
	}
	
}
